/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.migracion.pool;

import java.sql.Connection;
import java.sql.SQLException;

/**
 *
 * @author stevenziggiz
 */
public class Context {

    private DriverConnectionPool driverConnectionPool;

    public Context(DriverConnectionPool driverConnectionPool) {
        this.driverConnectionPool = driverConnectionPool;
    }

    /**
     * Hace la conexión según la instancia de {@code DriverConnectionPool}
     * suministrada.
     *
     * @return Retorna la conexión creada.
     * @throws ClassNotFoundException Lanza un {@code ClassNotFoundException} si
     * el driver no existe o falla.
     * @throws SQLException Lanza un {@code SQLException} si la conexión no se
     * pudo realizar.
     */
    public Connection conectar() throws ClassNotFoundException, SQLException {
        return driverConnectionPool.conectar();
    }
}
